

version 16.1
clear all
set more off
timer clear

*** This master script produces the main results in the paper

*** "The Heterogeneous Effects of Large and Small Minimum Wage Changes: Evidence over the Short and Medium Run Using a Pre-Analysis Plan"
*** by Jeffrey Clemens, and Michael R. Strain 


*External Packages:
*	- reghdfe version 6.12.2 02Nov2021
*	- ftools version 2.49.0 06may2022
*	- did_imputation version 2.0, 23apr2023
*	- grc1leg2 version 1.6 15Jun2021
*	- estout version 3.17  02jun2014 
*	- egenmore last revised 24jan2019
*	- erepost version 1.0.2, 15jun2015

*ssc install reghdfe, replace
*ssc install ftools, replace
*ssc install mplotoffset, replace
*ssc install estout, replace
*ssc install grc1leg2, replace 
*ssc install egenmore, replace
*ssc install erepost, replace

** Need to have $path point to the directory containing this README file
* If needed change global path to point to directory where files are stored on your computer
global path "I:/DataSets5/Duncan/Dropbox/Recent Minimum Wage Changes/2020.12 NBER Update/JOLE Precommittment Replication"

** Confirm that the globals for the project root directory and data folder exist
assert !missing("$path")

** Log Session
cap mkdir "$path/logfiles"
cap log close
local datetime : di %tcCCYY.NN.DD!_HH.MM.SS `=clock("$S_DATE $S_TIME", "DMYhms")'
local logfile "$path/logfiles/log_all_`datetime'.log"
log using "`logfile'"
di "Begin date and time: $S_DATE $S_TIME"

timer on 1

** Directories:
global dtadir "$path/Data"
global tabdir "$path/Tables"
global figdir "$path/Figures"
global estdir "$path/Estimates"
global logdir "$path/Logfiles"

*** Generate Main Tables and Figures

* Figure 1 Panels A and B
do "$codedir/Figure_1.do"

* Figure 2 Panel A
do "$codedir/Figure_2_Panel_A.do"

* Figure 2 Panel B
do "$codedir/Figure_2_Panel_B.do"

* Figure 3
do "$codedir/Figure_3.do"


* Summary Stats Tables 1 and 2, A1, and A5
do "$codedir/SummaryStatsStandard_ACS_CEPCategories.do"

* Summary Stats Tables A2 and A3, A4, and A6
do "$codedir/SummaryStatsStandard_CPS_CEPCategories.do"

* Summary Stats Table A7
do "$codedir/SummaryStatsStandard_ACS_NewNewCategories.do"

* Summary Stats Tables A8
do "$codedir/SummaryStatsStandard_CPS_NewNewCategories.do"

* Figure A1
do "$codedir/Figure_A1.do"

* Figure A2 Panel A
do "$codedir/Figure_A2_Panel_A.do"

* Figure A2 Panel B
do "$codedir/Figure_A2_Panel_B.do"


* Generate Dataset for use with Event Studies
do "$codedir/GenerateEventStudyDataset.do"

*** Appendix B

* Data for Figure B1
do "$codedir/analysis_ACS_EventStudyDesigns2013.do"

* Data for Figure B2
do "$codedir/analysis_ACS_EventStudyDesignsEventTimeNoCategories.do"

* Data for Figure B3
do "$codedir/analysis_ACS_EventStudyDesignsEventTimePolicyCategories_CombineIndexSmall.do"

* Figure B1
do "$codedir/Figure_B1.do"

* Figure B2
do "$codedir/Figure_B2.do"

* Figure B3
do "$codedir/Figure_8.do"

* Figure B4
do "$codedir/Figure_B4.do"

* Figure B5
do "$codedir/Figure_B5.do"


* Figure B6
do "$codedir/Figure_B6_Panel_A.do"

do "$codedir/Figure_B6_Panel_B.do"

do "$codedir/Figure_B6_Panel_C.do"

do "$codedir/Figure_B6_Panel_D.do"

do "$codedir/Figure_B6_Panel_E.do"

do "$codedir/Figure_B6_Panel_F.do"


* Figure 4 and Figure B7
do "$codedir/Figure_4_Panel_A.do"

do "$codedir/Figure_4_Panel_B.do"

do "$codedir/Figure_4_Panel_C.do"

do "$codedir/Figure_4_Panel_D.do"

do "$codedir/Figure_4_Panel_E.do"

do "$codedir/Figure_4_Panel_F.do"

* Figure B8
do "$codedir/Figure_B8.do"

* Figure B9
do "$codedir/Figure_B9.do"


* Figure B10
do "$codedir/Figure_B10_Panel_A.do"

do "$codedir/Figure_B10_Panel_B.do"

do "$codedir/Figure_B10_Panel_C.do"


* Figure B11
do "$codedir/Figure_B11_Panel_A.do"

do "$codedir/Figure_B11_Panel_B.do"

do "$codedir/Figure_B11_Panel_C.do"


*** Underlying Estimates for Table 3

* seed 123456
do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-lowskill-switchers-2015-2019.do"
do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-lowskill-switchers-2015-2015.do"
do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-lowskill-switchers-2019-2019.do"

do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-lowskill-noswitchers-2015-2019.do"
do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-lowskill-noswitchers-2019-2019.do"

do "$codedir/bootstrap/seed-123456/bootstrap-emp-new-lowskill-switchers-2019-2019.do"


do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-young-switchers-2015-2019.do"
do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-young-switchers-2015-2015.do"
do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-young-switchers-2019-2019.do"

do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-young-noswitchers-2015-2019.do"
do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-young-noswitchers-2019-2019.do"

do "$codedir/bootstrap/seed-123456/bootstrap-emp-new-young-switchers-2019-2019.do"


* seed 789012
do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-lowskill-switchers-2015-2019.do"
do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-lowskill-switchers-2015-2015.do"
do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-lowskill-switchers-2019-2019.do"

do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-lowskill-noswitchers-2015-2019.do"
do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-lowskill-noswitchers-2019-2019.do"

do "$codedir/bootstrap/seed-789012/bootstrap-emp-new-lowskill-switchers-2019-2019.do"


do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-young-switchers-2015-2019.do"
do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-young-switchers-2015-2015.do"
do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-young-switchers-2019-2019.do"

do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-young-noswitchers-2015-2019.do"
do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-young-noswitchers-2019-2019.do"

do "$codedir/bootstrap/seed-789012/bootstrap-emp-new-young-switchers-2019-2019.do"


*** Underlying Estimates for Table 4

* seed 123456
do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-lowskill-switchers-2015-2019-cs-2017.do"
do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-lowskill-switchers-2015-2015-cs-2017.do"
do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-lowskill-switchers-2019-2019-cs-2017.do"

do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-young-switchers-2015-2019-cs-2017.do"
do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-young-switchers-2015-2015-cs-2017.do"
do "$codedir/bootstrap/seed-123456/bootstrap-emp-cep-young-switchers-2019-2019-cs-2017.do"

* seed 789012
do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-lowskill-switchers-2015-2019-cs-2017.do"
do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-lowskill-switchers-2015-2015-cs-2017.do"
do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-lowskill-switchers-2019-2019-cs-2017.do"

do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-young-switchers-2015-2019-cs-2017.do"
do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-young-switchers-2015-2015-cs-2017.do"
do "$codedir/bootstrap/seed-789012/bootstrap-emp-cep-young-switchers-2019-2019-cs-2017.do"

*** Underlying Estimates for Table A9

* seed 123456
do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-lowskill-switchers-2015-2019.do"
do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-lowskill-switchers-2015-2015.do"
do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-lowskill-switchers-2019-2019.do"

do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-lowskill-noswitchers-2015-2019.do"
do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-lowskill-noswitchers-2019-2019.do"

do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-new-lowskill-switchers-2019-2019.do"


do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-young-switchers-2015-2019.do"
do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-young-switchers-2015-2015.do"
do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-young-switchers-2019-2019.do"

do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-young-noswitchers-2015-2019.do"
do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-young-noswitchers-2019-2019.do"

do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-new-young-switchers-2019-2019.do"


* seed 789012
do "$codedir/bootstrap/seed-789012/bootstrap-ow-mw-cep-lowskill-switchers-2015-2019.do"
do "$codedir/bootstrap/seed-789012/bootstrap-ow-mw-cep-lowskill-switchers-2015-2015.do"
do "$codedir/bootstrap/seed-789012/bootstrap-ow-mw-cep-lowskill-switchers-2019-2019.do"

do "$codedir/bootstrap/seed-789012/bootstrap-ow-mw-cep-lowskill-noswitchers-2015-2019.do"
do "$codedir/bootstrap/seed-789012/bootstrap-ow-mw-cep-lowskill-noswitchers-2019-2019.do"

do "$codedir/bootstrap/seed-789012/bootstrap-ow-mw-new-lowskill-switchers-2019-2019.do"


do "$codedir/bootstrap/seed-789012/bootstrap-ow-mw-cep-young-switchers-2015-2019.do"
do "$codedir/bootstrap/seed-789012/bootstrap-ow-mw-cep-young-switchers-2015-2015.do"
do "$codedir/bootstrap/seed-789012/bootstrap-ow-mw-cep-young-switchers-2019-2019.do"

do "$codedir/bootstrap/seed-789012/bootstrap-ow-mw-cep-young-noswitchers-2015-2019.do"
do "$codedir/bootstrap/seed-789012/bootstrap-ow-mw-cep-young-noswitchers-2019-2019.do"

do "$codedir/bootstrap/seed-789012/bootstrap-ow-mw-new-young-switchers-2019-2019.do"

*** Results for Table A10

* seed 123456
do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-lowskill-switchers-2015-2019-cs-2017.do"
do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-lowskill-switchers-2015-2015-cs-2017.do"
do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-lowskill-switchers-2019-2019-cs-2017.do"

do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-young-switchers-2015-2019-cs-2017.do"
do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-young-switchers-2015-2015-cs-2017.do"
do "$codedir/bootstrap/seed-123456/bootstrap-ow-mw-cep-young-switchers-2019-2019-cs-2017.do"

* seed 789012
do "$codedir/seed-789012/bootstrap-ow-mw-cep-lowskill-switchers-2015-2019-cs-2017.do"
do "$codedir/seed-789012/bootstrap-ow-mw-cep-lowskill-switchers-2015-2015-cs-2017.do"
do "$codedir/seed-789012/bootstrap-ow-mw-cep-lowskill-switchers-2019-2019-cs-2017.do"

do "$codedir/seed-789012/bootstrap-ow-mw-cep-young-switchers-2015-2019-cs-2017.do"
do "$codedir/seed-789012/bootstrap-ow-mw-cep-young-switchers-2015-2015-cs-2017.do"
do "$codedir/seed-789012/bootstrap-ow-mw-cep-young-switchers-2019-2019-cs-2017.do"


*** Table Output Table 5, A11, A12, and A13
do "$codedir/bootstrap/test-generate-elasticities-and-ci-v2-200-reps.do"




*** Results for Tables A14, A15 and A16 with no time-varying covariates

*** Underlying estimates for Table A14
do "$codedir/no-tvc/bootstrap-emp-cep-lowskill-switchers-2015-2019-no-tvc.do"
do "$codedir/no-tvc/bootstrap-emp-cep-lowskill-switchers-2015-2015-no-tvc.do"
do "$codedir/no-tvc/bootstrap-emp-cep-lowskill-switchers-2019-2019-no-tvc.do"

do "$codedir/no-tvc/bootstrap-emp-cep-lowskill-noswitchers-2015-2019-no-tvc.do"
do "$codedir/no-tvc/bootstrap-emp-cep-lowskill-noswitchers-2019-2019-no-tvc.do"

do "$codedir/no-tvc/bootstrap-emp-new-lowskill-switchers-2019-2019-no-tvc.do"


do "$codedir/no-tvc/bootstrap-emp-cep-young-switchers-2015-2019-no-tvc.do"
do "$codedir/no-tvc/bootstrap-emp-cep-young-switchers-2015-2015-no-tvc.do"
do "$codedir/no-tvc/bootstrap-emp-cep-young-switchers-2019-2019-no-tvc.do"

do "$codedir/no-tvc/bootstrap-emp-cep-young-noswitchers-2015-2019-no-tvc.do"
do "$codedir/no-tvc/bootstrap-emp-cep-young-noswitchers-2019-2019-no-tvc.do"

do "$codedir/no-tvc/bootstrap-emp-new-young-switchers-2019-2019-no-tvc.do"


*** Underlying estimates for Table A15
do "$codedir/no-tvc/bootstrap-ow-mw-cep-lowskill-switchers-2015-2019-no-tvc.do"
do "$codedir/no-tvc/bootstrap-ow-mw-cep-lowskill-switchers-2015-2015-no-tvc.do"
do "$codedir/no-tvc/bootstrap-ow-mw-cep-lowskill-switchers-2019-2019-no-tvc.do"

do "$codedir/no-tvc/bootstrap-ow-mw-cep-lowskill-noswitchers-2015-2019-no-tvc.do"
do "$codedir/no-tvc/bootstrap-ow-mw-cep-lowskill-noswitchers-2019-2019-no-tvc.do"

do "$codedir/no-tvc/bootstrap-ow-mw-new-lowskill-switchers-2019-2019-no-tvc.do"


do "$codedir/no-tvc/bootstrap-ow-mw-cep-young-switchers-2015-2019-no-tvc.do"
do "$codedir/no-tvc/bootstrap-ow-mw-cep-young-switchers-2015-2015-no-tvc.do"
do "$codedir/no-tvc/bootstrap-ow-mw-cep-young-switchers-2019-2019-no-tvc.do"

do "$codedir/no-tvc/bootstrap-ow-mw-cep-young-noswitchers-2015-2019-no-tvc.do"
do "$codedir/no-tvc/bootstrap-ow-mw-cep-young-noswitchers-2019-2019-no-tvc.do"

do "$codedir/no-tvc/bootstrap-ow-mw-new-young-switchers-2019-2019-no-tvc.do"


* Table Output for Tables A14 A15 and A16
do "$codedir/bootstrap/no-tvc/test-generate-elasticities-and-ci-no-tvc.do"


log close

timer off 1

timer list 1